<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  </head>
  <body>
    <p>web-view 组件加载网络 html 示例。点击下列按钮，跳转至其它页面。</p>
    <button id="navigateTo">navigateTo</button>
    <p class="desc">网页向应用发送消息，注意：小程序端应用会在此页面后退时接收到消息。</p>
    <button id="postMessage">postMessage</button>

    <!-- uni 的 SDK -->
    <script type="text/javascript" src="https://ya30wxmp.hbwlife.com/webview.js"></script>
    <script type="text/javascript">
      // 待触发 `UniAppJSBridgeReady` 事件后，即可调用 uni 的 API。
      document.addEventListener('UniAppJSBridgeReady', function() {
        console.log(111);  //这都不执行
        uni.postMessage({
            data: {
                action: 'message'
            }
        });
        document.getElementById('navigateTo').addEventListener('click', function() {
            uni.switchTab({
               url: '/pages/tabBar/API/API'
            });
        });
        document.getElementById('postMessage').addEventListener('click', function() {
          uni.postMessage({
            data: {
              action: 'message'
            }
          });
        });
      });
    </script>
  </body>
</html>
